<?php


namespace app\api\controller\v1;
use think\facade\Request;
use app\api\model\Cart;
use think\Db;
class Evaluation extends Base
{
   public function add(){
   	$token = request()->header('Token');
   	$data = Request::post();
  
   	$uid = $data['uid'];
   	$this->verifyToken($uid,$token);
    $res = db('order')->where('id',$data['id'])->where('user_id',$uid)->where('status',3)->find();
    if($res){
   	   model('evaluation')->add($data);
    }else{
    		return_json(400,'失败',false);
    }
   }


   public function select(){
   	$goods_id = Request::param('id');
   	model('evaluation')->sel($goods_id);
   }
}